package com.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.dao.DataAccessException;

import com.model.Provincia;
import com.query.BaseQuery;

public class ProvinciaDAOImpl extends BaseHibernateDAO<Provincia, BaseQuery> {

	@Override
	public Class<Provincia> getModelClass() {
		return Provincia.class;
	}

	@SuppressWarnings("unchecked")
	public List<Provincia> getList() throws DataAccessException {

		Query query = getSessionFactory().getCurrentSession().createQuery(
				"from Provincia");
		query.setCacheable(true);
		List<Provincia> objectList = query.list();

		return objectList;
	}
}
